package fei.zhou.springboot4.business.config.filter;

import java.util.Arrays;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 描述该类- JPA
 *
 * @author zhoufei
 * @class: Config
 * @date 2021/1/20 10:26
 * @Verson 1.0 -2021/1/20 10:26
 * @see
 */
@Configuration
public class FilterConfig {
    // 注册拦截器
    @Bean
    public FilterRegistrationBean myFilter(){
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(new MyFilter());
        //设置拦截规则
        registrationBean.setUrlPatterns(Arrays.asList("/test","/todoMyServlet"));
        return registrationBean;
    }
    
}